VintaSoft Imaging .NET SDK 14.0: Documentation for .NET developer
Vintasoft.Imaging.Drawing Namespace / DrawingEngine Class / RenderImage Methods / RenderImage(VintasoftImage,PointF[],RectangleF) Method
Syntax Example Requirements SeeAlso
In This Topic
    RenderImage(VintasoftImage,PointF[],RectangleF) Method (DrawingEngine)
    In This Topic
    Renders the specified portion of the specified VintasoftImage in the specified parallelogram.
    Syntax
    'Declaration
    
    Public Overloads Sub RenderImage( _
    ByVal image
    The VintasoftImage to render.
    As Vintasoft.Imaging.VintasoftImage, _
    ByVal destPoints
    An array of three System.Drawing.PointF structures that represents the points of a parallelogram to which the upper-left, upper-right, and lower-left corners.
    () As System.Drawing.PointF, _
    ByVal sourceRect
    The System.Drawing.RectangleF structure that specifies the portion of the image to render.
    As System.Drawing.RectangleF _
    )
    public:
    void RenderImage(
    Vintasoft.Imaging.VintasoftImage^ image,
    array<System.Drawing.PointF>^ destPoints,
    System.Drawing.RectangleF^ sourceRect
    )

    Parameters

    image
    The VintasoftImage to render.
    destPoints
    An array of three System.Drawing.PointF structures that represents the points of a parallelogram to which the upper-left, upper-right, and lower-left corners.
    sourceRect
    The System.Drawing.RectangleF structure that specifies the portion of the image to render.
    Example

    Here is an example that shows how to render image using drawing engine.

    
    ''' <summary>
    ''' Renders a vector image on specified drawing engine.
    ''' </summary>
    ''' <param name="drawingEngine">Drawing engine.</param>
    ''' <param name="area">Area to draw objects in.</param>
    Public Shared Sub RenderImageExample(drawingEngine As DrawingEngine, area As RectangleF)
        ' path to image file for drawing
        ' this image is located in <install path>/VintaSoft/Imaging .NET/Images/
        Dim imagePath As String = "PdfTextFields.pdf"
    
        ' create VintaSoft image
        Using image As New VintasoftImage(imagePath)
            ' create transform holder to save current engine transform and restore it aftewards
            Using drawingEngine.CreateTransformHolder()
                ' create image source rectangle, a part of image to draw
                Dim sourceImageRect As New RectangleF(0, 0, image.Width, image.Height * 0.5F)
                ' create image destination rectangle
                Dim destImageRect As New RectangleF(area.X, area.Y, area.Width * 0.5F, area.Height * 0.9F)
                ' apply skew transform to drawing engine
                drawingEngine.Transform = New AffineMatrix(1, 0, 0.2F, 1, 0, 0)
                ' draw image
                drawingEngine.RenderImage(image, destImageRect, sourceImageRect)
            End Using
        End Using
    End Sub
    
    
    
    /// <summary>
    /// Renders a vector image on specified drawing engine.
    /// </summary>
    /// <param name="drawingEngine">Drawing engine.</param>
    /// <param name="area">Area to draw objects in.</param>
    public static void RenderImageExample(DrawingEngine drawingEngine, RectangleF area)
    {
        // path to image file for drawing
        // this image is located in <install path>/VintaSoft/Imaging .NET/Images/
        string imagePath = "PdfTextFields.pdf";
    
        // create VintaSoft image
        using (VintasoftImage image = new VintasoftImage(imagePath))
        // create transform holder to save current engine transform and restore it aftewards
        using (drawingEngine.CreateTransformHolder())
        {
            // create image source rectangle, a part of image to draw
            RectangleF sourceImageRect = new RectangleF(0, 0, image.Width, image.Height * 0.5f);
            // create image destination rectangle
            RectangleF destImageRect = new RectangleF(area.X, area.Y, area.Width * 0.5f, area.Height * 0.9f);
            // apply skew transform to drawing engine
            drawingEngine.Transform = new AffineMatrix(1, 0, 0.2f, 1, 0, 0);
            // draw image
            drawingEngine.RenderImage(image, destImageRect, sourceImageRect);
        }
    }
    
    

    Requirements

    Target Platforms: .NET9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also